// component/recordBox/recordBox.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    list: {
      type: Object,
      value: '',
      observer() {
        this.color();
      }
    },
  },

  /**
   * 组件的初始数据
   */
  data: {
    // color:["rgba(75,213,157,1),rgba(59,112,255,1),rgba(254, 76, 76, 1)"]
    color:"rgba(75,213,157,1)"
  },

  /**
   * 组件的方法列表
   */
  methods: {
    color(){
      console.log(this.data.list.temperature)
      if(parseFloat(this.data.list.temperature)>36.0&&parseFloat(this.data.list.temperature)<37.2){
        this.setData({
          color:"rgba(75,213,157,1)",
        })
      }else if(parseFloat(this.data.list.temperature)<=36){
        this.setData({
          color:"rgba(59,112,255,1)",
        })
      }else if(parseFloat(this.data.list.temperature)>37.1){
        this.setData({
          color:"rgba(254, 76, 76, 1)",
        })
      }
    },
  }
})
